<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">

    <p:outputPanel id="ordPanel" layout="block" style="margin: 50px 0;">

        <h:form id="ord-formId">
            <p:dataTable id="ordData" var="o" value="#{folderAdministrationBean.orders}"
                         emptyMessage="Nu sunt inregistrari pentru dosarul curent"
                         styleClass="data-table-style data-table-panel">

                <p:column headerText="Ordin de" sortBy="#{o}">
                    <h:outputText value="#{o}"/>
                </p:column>

                <p:column headerText="Data crearii" sortBy="#{o.createdDate}">
                    <h:outputText value="#{o.createdDate}">
                        <f:convertDateTime pattern="dd/MM/yyyy"/>
                    </h:outputText>
                </p:column>

                <p:column>
                    <p:commandLink value="Vizualizeaza textul" actionListener="#{folderAdministrationBean.setSelectedFolder(o)}"
                                   oncomplete="PF('view_order').show();" update=":folder_details_content:folder_details_content:view_ordin_form"/>
                </p:column>

            </p:dataTable>

            <p:commandButton value="Incarca ordine mai vechi"
                             actionListener="#{folderAdministrationBean.loadNextOrders}" update="@form"/>
        </h:form>

        <ui:include src="view-order-details-dialog.xhtml"/>
    </p:outputPanel>


</ui:composition>